﻿<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Equipment.DataAccess" %>
<table class="data-table">
    <thead>
        <tr>
            <th>
                Site
            </th>
            <th>
                Username
            </th>
            <th>
                Security Role
            </th>
            <th>
                Status
            </th>
            <th>
                Edit
            </th>
        </tr>
    </thead>
    <tbody>
        <% For Each userItem As User In ViewData("Users")%>
        <tr>
            <td>
                <%: userItem.Site.Description%>
            </td>
            <td>
                <%: userItem.Username%>
            </td>
            <td>
                <%= String.Join(", ", userItem.Roles.Select(Function(r) r.Description))%>
            </td>
            <td>
                <%  If userItem.IsActive = True Then%>
                Active
                <%  Else%>
                Inctive
                <%  End If%>
            </td>
            <td>
                <a href="javascript:selectUser(<%: userItem.ID%>,<%: userItem.SiteID%>);">Edit</a>
            </td>
        </tr>
        <% Next%>
    </tbody>
</table>
